package cn.net.xyan.blossom.core

import cn.net.xyan.blossom.core.service.ConfigService
import cn.net.xyan.blossom.core.service.ConfigServiceImpl
import cn.net.xyan.blossom.core.service.LogService
import cn.net.xyan.blossom.core.service.LogServiceImpl
import cn.net.xyan.blossom.kotlin.AllOpen
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.boot.autoconfigure.domain.EntityScan
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Configuration
import org.springframework.data.jpa.repository.config.EnableJpaRepositories


@AllOpen
@Configuration
@ComponentScan
@EnableJpaRepositories(basePackages = arrayOf("cn.net.xyan.blossom.core.dao"))
@EntityScan
class BlossomCoreConfiguration{
    @Bean
    @ConditionalOnMissingBean
    fun configService(): ConfigService {
        return ConfigServiceImpl()
    }

    @Bean
    @ConditionalOnMissingBean
    fun logService(): LogService {
        return LogServiceImpl()
    }
}